package com.ccc.ka.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.beans.factory.annotation.Autowired;
import com.ccc.ka.util.KAResponse;
import org.springframework.web.bind.annotation.*;
import com.ccc.ka.service.IMemoService;
import com.ccc.ka.entity.Memo;
import com.ccc.ka.util.BaseController;

/**
 * 
 * @author ccc
 * @since 2023-03-10
 */
@RestController
@RequestMapping("/memo")
public class MemoController extends BaseController {

@Autowired
private IMemoService memoService;

@PostMapping("/saveMemo")
public KAResponse saveMemo(Memo memo){
    return success(memoService.save(memo));
}

@DeleteMapping("/delMemo")
public KAResponse delMemo(Memo memo){
    return success(memoService.removeById(memo));
}

@PutMapping("/updMemo")
public KAResponse putMemo(Memo memo){
    return success(memoService.updateById(memo));
}

@GetMapping("/getMemo")
public KAResponse getMemo(String id){
    return success(memoService.getById(id));
}

@GetMapping("/getMemoList")
public KAResponse getMemoList(Memo memo){
    return success(memoService.list());
}

@GetMapping("/getMemoPage")
public KAResponse getMemoPage(Memo memo){
    return success(memoService.list());
}

}
